<template>
  <div class="analyse-mainpage">
    <el-row>
      <el-col :span="24" class="rowtitle">
        <div>
          <el-button type="primary" @click="1">添加</el-button>
          <el-button type="primary" @click="1">查询</el-button>
        </div>
        <div>
          <el-button type="primary" @click="1">导入导出</el-button>
        </div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <!--列表-->
        <el-table
          :data="maintains"
          highlight-current-row
          v-loading="listLoading"
          border
          @selection-change="selsChange"
        >
          <el-table-column type="selection" width="55" align="center"></el-table-column>
          <el-table-column type="index" width="60"></el-table-column>
          <el-table-column prop="time" label="时间" align="center">
            <template slot-scope="scope">{{scope.row.time*1000 | paraseSyslogTime}}</template>
          </el-table-column>
          <el-table-column prop="type" label="告警类型" align="center"></el-table-column>
          <el-table-column prop="content" label="告警内容" align="center"></el-table-column>
          <el-table-column label="操作" width align="center">
            <template scope="scope">
              <el-button size="small" @click="deleteone(scope.row)">删除</el-button>
              <el-button size="small" @click="deleteone(scope.row)">修改</el-button>
              <el-button size="small" @click="deleteone(scope.row)">配置</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24" style="margin: 10px;text-align: center;">
        <el-pagination
          @size-change="1"
          @current-change="1"
          :current-page="1"
          :page-sizes="[100, 200, 300, 400]"
          :page-size="100"
          layout="total, sizes, prev, pager, next, jumper"
          :total="400"
        ></el-pagination>
      </el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  components: {},

  data() {
    return {
      maintains: [],
      listLoading: false,
      tunnelList: [],
      tunnelcode: ""
    };
  },

  mounted() {
    this.initData();
  },

  methods: {
    switchTunnel(code) {
      this.tunnelcode = code;
    },

    initData() {
      let _this = this;
      let aaa = {
        1: {
          time: 1560220053,
          code: 1,
          type: "火灾",
          content: "tsetsetsetstsets"
        },
        2: {
          time: 1560220053,
          code: 2,
          type: "后台接口",
          content: "tsetsetsetstsets"
        },
        3: {
          time: 1560220053,
          code: 3,
          type: "websock提示",
          content: "tsetsetsetstsets"
        },
        4: {
          time: 1560220053,
          code: 4,
          type: "火灾",
          content: "tsetsetsetstsets"
        },
        5: {
          time: 1560220053,
          code: 5,
          type: "websock提示",
          content: "tsetsetsetstsets"
        },
        6: {
          time: 1560220053,
          code: 6,
          type: "后台接口",
          content: "tsetsetsetstsets"
        },
        7: {
          time: 1560220053,
          code: 7,
          type: "火灾",
          content: "tsetsetsetstsets"
        },
        8: {
          time: 1560220053,
          code: 8,
          type: "后台接口",
          content: "tsetsetsetstsets"
        },
        9: {
          time: 1560220053,
          code: 9,
          type: "websock提示",
          content: "tsetsetsetstsets"
        },
        10: {
          time: 1560220053,
          code: 10,
          type: "后台接口",
          content: "tsetsetsetstsets"
        },
        11: {
          time: 1560220053,
          code: 11,
          type: "火灾",
          content: "tsetsetsetstsets"
        },
        12: {
          time: 1560220053,
          code: 12,
          type: "后台接口",
          content: "tsetsetsetstsets"
        },
        13: {
          time: 1560220053,
          code: 13,
          type: "火灾",
          content: "tsetsetsetstsets"
        },
        14: {
          time: 1560220053,
          code: 14,
          type: "后台接口",
          content: "tsetsetsetstsets"
        }
      };
      this.maintains = Object.keys(aaa).map(item => {
        return aaa[item];
      });
    }
  }
};
</script>
<style lang="scss">
.rowtitle {
  padding: 20px 50px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  background-color: #DCDFE6;
}

.el-card {
  margin: 10px;
}
</style>
